Integrand size = 24, antiderivative size = 214 \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\frac {a^2 (e x)^{2 n}}{2 e n}-\frac {4 a b x^{-n} (e x)^{2 n} \text {arctanh}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}-\frac {b^2 x^{-n} (e x)^{2 n} \cot \left (c+d x^n\right )}{d e n}+\frac {b^2 x^{-2 n} (e x)^{2 n} \log \left (\sin \left (c+d x^n\right )\right )}{d^2 e n}+\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )}{d^2 e n} \]
1/2*a^2*(e*x)^(2*n)/e/n-4*a*b*(e*x)^(2*n)*arctanh(exp(I*(c+d*x^n)))/d/e/n/ (x^n)-b^2*(e*x)^(2*n)*cot(c+d*x^n)/d/e/n/(x^n)+b^2*(e*x)^(2*n)*ln(sin(c+d* x^n))/d^2/e/n/(x^(2*n))+2*I*a*b*(e*x)^(2*n)*polylog(2,-exp(I*(c+d*x^n)))/d ^2/e/n/(x^(2*n))-2*I*a*b*(e*x)^(2*n)*polylog(2,exp(I*(c+d*x^n)))/d^2/e/n/( x^(2*n))
Time = 7.77 (sec) , antiderivative size = 286, normalized size of antiderivative = 1.34 \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\frac {x^{-2 n} (e x)^{2 n} \left (2 b^2 d x^n \cot (c)+d x^n \left (a^2 d x^n-2 b^2 \cot (c)\right )-2 b^2 \left (d x^n \cot (c)-\log \left (\sin \left (c+d x^n\right )\right )\right )+4 a b \left (2 \arctan (\tan (c)) \text {arctanh}\left (\cos (c)-\sin (c) \tan \left (\frac {d x^n}{2}\right )\right )+\frac {\left (\left (d x^n+\arctan (\tan (c))\right ) \left (\log \left (1-e^{i \left (d x^n+\arctan (\tan (c))\right )}\right )-\log \left (1+e^{i \left (d x^n+\arctan (\tan (c))\right )}\right )\right )+i \operatorname {PolyLog}\left (2,-e^{i \left (d x^n+\arctan (\tan (c))\right )}\right )-i \operatorname {PolyLog}\left (2,e^{i \left (d x^n+\arctan (\tan (c))\right )}\right )\right ) \sec (c)}{\sqrt {\sec ^2(c)}}\right )+b^2 d x^n \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} \left (c+d x^n\right )\right ) \sin \left (\frac {d x^n}{2}\right )+b^2 d x^n \sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} \left (c+d x^n\right )\right ) \sin \left (\frac {d x^n}{2}\right )\right )}{2 d^2 e n} \]
((e*x)^(2*n)*(2*b^2*d*x^n*Cot[c] + d*x^n*(a^2*d*x^n - 2*b^2*Cot[c]) - 2*b^ 2*(d*x^n*Cot[c] - Log[Sin[c + d*x^n]]) + 4*a*b*(2*ArcTan[Tan[c]]*ArcTanh[C os[c] - Sin[c]*Tan[(d*x^n)/2]] + (((d*x^n + ArcTan[Tan[c]])*(Log[1 - E^(I* (d*x^n + ArcTan[Tan[c]]))] - Log[1 + E^(I*(d*x^n + ArcTan[Tan[c]]))]) + I* PolyLog[2, -E^(I*(d*x^n + ArcTan[Tan[c]]))] - I*PolyLog[2, E^(I*(d*x^n + A rcTan[Tan[c]]))])*Sec[c])/Sqrt[Sec[c]^2]) + b^2*d*x^n*Csc[c/2]*Csc[(c + d* x^n)/2]*Sin[(d*x^n)/2] + b^2*d*x^n*Sec[c/2]*Sec[(c + d*x^n)/2]*Sin[(d*x^n) /2]))/(2*d^2*e*n*x^(2*n))
Time = 0.45 (sec) , antiderivative size = 141, normalized size of antiderivative = 0.66, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {4697, 4693, 3042, 4678, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (e x)^{2 n-1} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 4697 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^{2 n-1} \left (a+b \csc \left (d x^n+c\right )\right )^2dx}{e}\) |
\(\Big \downarrow \) 4693 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \csc \left (d x^n+c\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \csc \left (d x^n+c\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 4678 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int \left (a^2 x^n+b^2 \csc ^2\left (d x^n+c\right ) x^n+2 a b \csc \left (d x^n+c\right ) x^n\right )dx^n}{e n}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \left (\frac {1}{2} a^2 x^{2 n}-\frac {4 a b x^n \text {arctanh}\left (e^{i \left (c+d x^n\right )}\right )}{d}+\frac {2 i a b \operatorname {PolyLog}\left (2,-e^{i \left (d x^n+c\right )}\right )}{d^2}-\frac {2 i a b \operatorname {PolyLog}\left (2,e^{i \left (d x^n+c\right )}\right )}{d^2}+\frac {b^2 \log \left (\sin \left (c+d x^n\right )\right )}{d^2}-\frac {b^2 x^n \cot \left (c+d x^n\right )}{d}\right )}{e n}\) |
((e*x)^(2*n)*((a^2*x^(2*n))/2 - (4*a*b*x^n*ArcTanh[E^(I*(c + d*x^n))])/d - (b^2*x^n*Cot[c + d*x^n])/d + (b^2*Log[Sin[c + d*x^n]])/d^2 + ((2*I)*a*b*P olyLog[2, -E^(I*(c + d*x^n))])/d^2 - ((2*I)*a*b*PolyLog[2, E^(I*(c + d*x^n ))])/d^2))/(e*n*x^(2*n))
3.1.77.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol ] :> Simp[1/n Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Csc[c + d*x])^ p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m + 1)/n], 0] && IntegerQ[p]
Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*((e_)*(x_))^(m_.), x _Symbol] :> Simp[e^IntPart[m]*((e*x)^FracPart[m]/x^FracPart[m]) Int[x^m*( a + b*Csc[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 1.80 (sec) , antiderivative size = 970, normalized size of antiderivative = 4.53
1/2*a^2/n*x*exp(1/2*(-1+2*n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi+I*csgn (I*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*e*x)^2*Pi-I*csgn(I*e*x)^3*Pi+2*l n(e)+2*ln(x)))-2*I*x*b^2*exp(1/2*(-1+2*n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e *x)*Pi+I*csgn(I*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*e*x)^2*Pi-I*csgn(I* e*x)^3*Pi+2*ln(e)+2*ln(x)))/d/n/(x^n)/(exp(2*I*(c+d*x^n))-1)+1/n/d^2*b^2*( e^n)^2/e*exp(1/2*I*Pi*csgn(I*e*x)*(-1+2*n)*(csgn(I*e*x)-csgn(I*x))*(-csgn( I*e*x)+csgn(I*e)))*ln(exp(2*I*(c+d*x^n))-1)-2/n/d^2*b^2*(e^n)^2/e*exp(1/2* I*Pi*csgn(I*e*x)*(-1+2*n)*(csgn(I*e*x)-csgn(I*x))*(-csgn(I*e*x)+csgn(I*e)) )*ln(exp(I*x^n*d))+2/n/d*b*a/e*(e^n)^2*ln(1-exp(I*(c+d*x^n)))*x^n*(-1)^(1/ 2*csgn(I*e)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e*x )^2*n+2*csgn(I*e)*csgn(I*e*x)*n+2*csgn(I*x)*csgn(I*e*x)*n-2*csgn(I*e)*csgn (I*x)*n+csgn(I*e*x)^2-csgn(I*e)*csgn(I*e*x)-csgn(I*x)*csgn(I*e*x)))-2/n/d* b*a/e*(e^n)^2*ln(exp(I*(c+d*x^n))+1)*x^n*(-1)^(1/2*csgn(I*e)*csgn(I*x)*csg n(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e*x)^2*n+2*csgn(I*e)*csgn(I* e*x)*n+2*csgn(I*x)*csgn(I*e*x)*n-2*csgn(I*e)*csgn(I*x)*n+csgn(I*e*x)^2-csg n(I*e)*csgn(I*e*x)-csgn(I*x)*csgn(I*e*x)))-2*I/n/d^2*b*a/e*(e^n)^2*dilog(1 -exp(I*(c+d*x^n)))*(-1)^(1/2*csgn(I*e)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi *csgn(I*e*x)*(-2*csgn(I*e*x)^2*n+2*csgn(I*e)*csgn(I*e*x)*n+2*csgn(I*x)*csg n(I*e*x)*n-2*csgn(I*e)*csgn(I*x)*n+csgn(I*e*x)^2-csgn(I*e)*csgn(I*e*x)-csg n(I*x)*csgn(I*e*x)))+2*I/n/d^2*b*a/e*(e^n)^2*dilog(exp(I*(c+d*x^n))+1)*...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 568 vs. \(2 (206) = 412\).
Time = 0.28 (sec) , antiderivative size = 568, normalized size of antiderivative = 2.65 \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\frac {a^{2} d^{2} e^{2 \, n - 1} x^{2 \, n} \sin \left (d x^{n} + c\right ) - 2 \, b^{2} d e^{2 \, n - 1} x^{n} \cos \left (d x^{n} + c\right ) - 2 i \, a b e^{2 \, n - 1} {\rm Li}_2\left (\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right )\right ) \sin \left (d x^{n} + c\right ) + 2 i \, a b e^{2 \, n - 1} {\rm Li}_2\left (\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right )\right ) \sin \left (d x^{n} + c\right ) - 2 i \, a b e^{2 \, n - 1} {\rm Li}_2\left (-\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right )\right ) \sin \left (d x^{n} + c\right ) + 2 i \, a b e^{2 \, n - 1} {\rm Li}_2\left (-\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right )\right ) \sin \left (d x^{n} + c\right ) - {\left (2 \, a b c - b^{2}\right )} e^{2 \, n - 1} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2} i \, \sin \left (d x^{n} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{n} + c\right ) - {\left (2 \, a b c - b^{2}\right )} e^{2 \, n - 1} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) - \frac {1}{2} i \, \sin \left (d x^{n} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{n} + c\right ) - {\left (2 \, a b d e^{2 \, n - 1} x^{n} - b^{2} e^{2 \, n - 1}\right )} \log \left (\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + 1\right ) \sin \left (d x^{n} + c\right ) - {\left (2 \, a b d e^{2 \, n - 1} x^{n} - b^{2} e^{2 \, n - 1}\right )} \log \left (\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + 1\right ) \sin \left (d x^{n} + c\right ) + 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \log \left (-\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + 1\right ) \sin \left (d x^{n} + c\right ) + 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \log \left (-\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + 1\right ) \sin \left (d x^{n} + c\right )}{2 \, d^{2} n \sin \left (d x^{n} + c\right )} \]
1/2*(a^2*d^2*e^(2*n - 1)*x^(2*n)*sin(d*x^n + c) - 2*b^2*d*e^(2*n - 1)*x^n* cos(d*x^n + c) - 2*I*a*b*e^(2*n - 1)*dilog(cos(d*x^n + c) + I*sin(d*x^n + c))*sin(d*x^n + c) + 2*I*a*b*e^(2*n - 1)*dilog(cos(d*x^n + c) - I*sin(d*x^ n + c))*sin(d*x^n + c) - 2*I*a*b*e^(2*n - 1)*dilog(-cos(d*x^n + c) + I*sin (d*x^n + c))*sin(d*x^n + c) + 2*I*a*b*e^(2*n - 1)*dilog(-cos(d*x^n + c) - I*sin(d*x^n + c))*sin(d*x^n + c) - (2*a*b*c - b^2)*e^(2*n - 1)*log(-1/2*co s(d*x^n + c) + 1/2*I*sin(d*x^n + c) + 1/2)*sin(d*x^n + c) - (2*a*b*c - b^2 )*e^(2*n - 1)*log(-1/2*cos(d*x^n + c) - 1/2*I*sin(d*x^n + c) + 1/2)*sin(d* x^n + c) - (2*a*b*d*e^(2*n - 1)*x^n - b^2*e^(2*n - 1))*log(cos(d*x^n + c) + I*sin(d*x^n + c) + 1)*sin(d*x^n + c) - (2*a*b*d*e^(2*n - 1)*x^n - b^2*e^ (2*n - 1))*log(cos(d*x^n + c) - I*sin(d*x^n + c) + 1)*sin(d*x^n + c) + 2*( a*b*d*e^(2*n - 1)*x^n + a*b*c*e^(2*n - 1))*log(-cos(d*x^n + c) + I*sin(d*x ^n + c) + 1)*sin(d*x^n + c) + 2*(a*b*d*e^(2*n - 1)*x^n + a*b*c*e^(2*n - 1) )*log(-cos(d*x^n + c) - I*sin(d*x^n + c) + 1)*sin(d*x^n + c))/(d^2*n*sin(d *x^n + c))
\[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\int \left (e x\right )^{2 n - 1} \left (a + b \csc {\left (c + d x^{n} \right )}\right )^{2}\, dx \]
\[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \csc \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \]
1/2*(e*x)^(2*n)*a^2/(e*n) - (2*b^2*e^(2*n)*x^n*sin(2*d*x^n + 2*c) - (d*e*n *cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x^n + 2*c) + d*e*n)*integrate((2*a*b*d*e^(2*n)*x^(2*n) - b^2*e^(2*n)*x^n)*sin(d *x^n + c)/(d*e*x*cos(d*x^n + c)^2 + d*e*x*sin(d*x^n + c)^2 + 2*d*e*x*cos(d *x^n + c) + d*e*x), x) - (d*e*n*cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x^n + 2*c) + d*e*n)*integrate((2*a*b*d*e^(2*n)*x ^(2*n) + b^2*e^(2*n)*x^n)*sin(d*x^n + c)/(d*e*x*cos(d*x^n + c)^2 + d*e*x*s in(d*x^n + c)^2 - 2*d*e*x*cos(d*x^n + c) + d*e*x), x))/(d*e*n*cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x^n + 2*c) + d*e*n )
\[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \csc \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \]
Timed out. \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\int {\left (a+\frac {b}{\sin \left (c+d\,x^n\right )}\right )}^2\,{\left (e\,x\right )}^{2\,n-1} \,d x \]